#ifndef __DKGL_KERNEL_H__
#define __DKGL_KERNEL_H__

#include <memory>
#include "dkglFwdDec.h"
#include "dkglFrameListener.h"


namespace DKGL
{
	class Kernel
	{
	public:

		void init();
		{
		}

		inline void frameStarted(float dt)
		{
			if (_frmListener)
			{
				_frmListener->frameStarted(dt);
			}
		}

		inline void frameEnded(float dt)
		{
			if (_frmListener)
			{
				_frmListener->frameEnded(dt);
			}
		}

		void update(float dt);
		void render(float dt);

		inline void registerFrameListener(FrameListener* listener)
		{
			_frmListener = listener;
		}

		void onWindowResize(int width, int height);

		static Kernel& instance()
		{
			static Kernel instance;
			return instance;
		}

	private:

		std::auto_ptr<ViewportManager>	_viewportManagerPtr;
		std::auto_ptr<SceneManager>		_sceneManagerPtr;

		FrameListener* _frmListener;

		Kernel();

	};
}

#endif